import { faker } from "@faker-js/faker";
import { BlogType } from "@/types/blog";

const createBlogs = (): BlogType[] => {
  return Array.from({ length: 50 }, (_, i) => ({
    id: i + 1,
    title: faker.lorem.sentence({ min: 3, max: 8 }),
    createdAt: faker.date.past().toISOString(),
    tags: faker.lorem.words({ min: 2, max: 5 }).split(" "),
  }));
};

export async function GET() {
  return Response.json(createBlogs());
}
